#include "Complex.h"
#include <iostream>
using namespace std;
Complex::Complex(){
	//cout<<"Complex()"<<endl;
}
Complex::Complex(double d,double i){
	_real=d;
	_image=i;
}
Complex::~Complex(){
	//cout<<"~Complex()"<<endl;
}
Complex& Complex::operator=(const Complex& c){
	if(this!=& c){
		_real=c._real;
		_image=c._image;
	}
	return *this;
}
Complex Complex::operator+(const Complex& c) const{
    return Complex(_real+c._real,_image+c._image);
}
Complex Complex::operator-(const Complex& c) const{
    return Complex(_real-c._real,_image-c._image);
}
Complex Complex::operator+=(const Complex& c){
	_real+=c._real;
	_image+=c._image;
	return *this;
}
Complex Complex::operator-=(const Complex& c){
	_real-=c._real;
	_image-=c._image;
	return *this;
}
bool Complex::operator==(const Complex& c) const{
    return (_real==c._real)&&(_image==c._image);
}
bool Complex::operator!=(const Complex& c) const{
    return (_real!=c._real)||(_image!=c._image);
}
double Complex::getreal(){
	return _real; 
}
void Complex::setreal(double d){
	_real=d;
}
double Complex::getimage(){
	return _image;
}
void Complex::setimage(double i){
	_image=i; 
}
ostream& operator<<(ostream& os,Complex& c){
	os<<"real`s value is: "<<c._real<<" ;image`s value is: "<<c._image<<endl;
	return os;
}
istream& operator>>(istream& is,Complex& c){
	is>>c._real>>c._image;
	return is;
}
